<%@page import="sdfi.lee.DAO.YiqiDAO"%>
<%@page import="sdfi.lee.Entity.Yiqishare"%>
<%@page import="java.net.URLDecoder"%>
<%@page import="sdfi.lee.Newpj.DAO.NewsDAO"%>
<%@page import="java.util.List"%>
<%@page import="sdfi.lee.Newpj.Entity.NNews"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
    <%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
    <%@taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<link rel="stylesheet" href="../css/index.css" />
<link rel="stylesheet" href="../css/level.css" />
<style type="text/css">
	<!--
	.tdclass{
			font-size:14px;
			border:1px solid #000000;
			border-left:none;
			border-bottom:none;
			word-break: break-all; word-wrap:break-word;
		}
		.thclass{
		word-break: break-all; word-wrap:break-word;
		border:1px solid #000000;
		border-left:none;
		border-bottom:none;
		border-top:none;
		font-size:18px;
		font-weight:bold;
		padding:4px 0px;
		
		}
		table{
		border:1px solid #000;
		margin-top:10px;
		}
	 -->
</style>
<script type="text/javascript" src="../js/jquery-1.6.js" ></script>
<script type="text/javascript" src="../js/index.js"></script>
<script type="text/javascript">
			$(function(){
				
				$("a[content]").click(function(){
					var c=$(this).parents("tr").css("background-color");
					$(this).parents("tr:first").next("tr").css("background-color",c).children().html($(this).attr("content")).show();
					$(this).parents("tr").siblings(".show").next().children("td").hide();
					return false;
				});
				$("a[action]").hover(function(){
					var aget=$(this);
					$(this).parents("tr").next("tr").css("background-color",$(this).parents("tr").css("background-color"))
					.children("td").html("正在加载...").show();
					var td=$(this);
					$.ajax({
						dataType:"text",
						type:"get",
						url:td.attr("action"),
						data:{entityName:aget.text(),t:new Date()},
						success:function(data,status){
							td.parents("tr").next("tr").children("td").html(data);
						},
					error:function(xhr,status){
						
						td.parents("tr").next("tr").children("td").html("系统出错了");
					}
					});
					td.parents("tr").siblings(".show").next().children("td").hide();
				},function(){
					
				});
			});
			
		</script>
<title>国家新药创制平台（山东）</title>
<meta content="<a href='<c:url value='/yiqi/yiqilist.jsp?pg=1'/>'>仪器共享</a>" name="location">
</head>
<body>
<%
	String pg=request.getParameter("pg");
String yiqiname=request.getParameter("yiqiname");
String userfor=request.getParameter("userfor");
String relation=request.getParameter("relation");
String unit=request.getParameter("unit");
String factory=request.getParameter("factory");
if(userfor!=null) userfor=URLDecoder.decode(userfor);
if(yiqiname!=null) yiqiname=URLDecoder.decode(yiqiname);
if(relation!=null) relation=URLDecoder.decode(relation);
if(unit!=null) unit=URLDecoder.decode(unit);
if(factory!=null) factory=URLDecoder.decode(factory);
List<Yiqishare> list=new YiqiDAO().getAllYiqi(Integer.valueOf(pg).intValue(),20,yiqiname,userfor,unit,factory,relation);
request.setAttribute("list",list);
%>

            <div style="margin:5px;text-align:left;padding:0 0 5px 10px;border-bottom:1px dotted #2fa1c6;">
		
		<form action="<c:url value='/yiqi/yiqilist.jsp' />" method="get">
			<fieldset>
				<legend>仪器查询</legend>
				<label>仪器名称：</label><input name="yiqiname" type="text" style="width:115px;">
				<label>仪器用途：</label><input name="userfor" type="text" style="width:115px;">
				<label>联系人:</label><input name="relation" type="text" style="width:115px;"> <br>
				<label>所在单位：</label><input name="unit" type="text" style="width:115px;">
				<label>生产厂家：</label><input name="factory" type="text" style="width:115px;">
		<input type="hidden" value="1" name="pg">
		<input type="hidden" value="1" name="first">
		<input type="submit" value="查询">
			</fieldset>
		
		</form>
	</div>
            
            	<table width="100%" cellspacing="0" border="0">
            			<tr>
				<th class="thclass" style="width:15px;">编号</th>
				<th class="thclass" style="width:100px;">
					仪器设备名称
				</th>
				<th class="thclass" style="width:100px;"> 
					仪器类型
				</th>
				<th class="thclass" style="width:100px;">
					生产厂家
				</th>
				<th class="thclass" style="width:100px;">
					所属单位
				</th>
			<th class="thclass" style="width:70px;">
					联系人
				</th>
					<th class="thclass" style="width:100px;">
					联系方式
			</th>
				<th class="thclass" style="width:40px;border-right:none;">
					用途
				</th>
			</tr>
            	<c:forEach items="${requestScope.list}" var="shareyiqi" varStatus="status">
				<c:choose>
					<c:when test="${status.index%2==0 }">
					<tr style="background-color:#cccccc" class="show">
					</c:when>
				<c:otherwise>
					<tr class="show">
				</c:otherwise>
					
				</c:choose>
					<td class="tdclass">${(status.index+1)}</td>
					<td class="tdclass" id="getrl" >
						<a  action="<c:url value='/GetRelationYiqi'/>" style="cursor:pointer">${shareyiqi.yiqiname}</a>
					</td>
					<td class="tdclass">
						${shareyiqi.yiqitype}
					</td>
					<td class="tdclass" id="getrl">
						<a  style="cursor:pointer" action="<c:url value='/GetRelationYiqi'/>" >${shareyiqi.factory}</a>
					</td>
					<td class="tdclass" id="getrl" >
						<a  style="cursor:pointer" action="<c:url value='/GetRelationYiqi'/>" >${shareyiqi.unit}</a>
					</td>
					<td class="tdclass" id="getrl"  style="cursor:pointer">
						<a  style="cursor:pointer" action="<c:url value='/GetRelationYiqi'/>" >${shareyiqi.relation}</a>
					</td>
					<td class="tdclass">
						${shareyiqi.phone}
					</td>
					<td class="tdclass" style="border-right:none;" >
						<a style="cursor:pointer" title="点击显示详情" content="${shareyiqi.userfor}">详情</a>
					</td>
				</tr>
				<tr>
					<td class="tdclass" colspan="8" style="display:none;padding:5px 5px 5px 0px;text-align:left">
						${shareyiqi.userfor}
					</td>
				</tr>
				
		</c:forEach>
            	 </table>
                <div id="pages" style="margin-top:20px;">
                	
                	         	
                每页<span>20</span>条,第<span>${param.pg}</span>页,该页
                	<span>${fn:length(requestScope.list) }</span>条
                    <c:choose>
                		<c:when test='${param.pg==null||param.pg==""||param.pg==1}'>
                			上页
                		</c:when>
                		<c:otherwise>
                			<c:url value='/yiqi/yiqilist.jsp?
                			pg=${param.pg-1}&userfor=${param.userfor}&yiqiname=${param.yiqiname}&unit=${param.unit}&factory=${param.factory}&relation=${param.relation }'
                			 var="down"/>
                			 <a href="${down}">上页</a>
                		</c:otherwise>
                	</c:choose>
                	
                   	<c:choose>
                   		<c:when test="${fn:length(requestScope.list)<20}">
                   			下页
                   		</c:when>
                   		<c:otherwise>
                   		<a href="<c:url value='/yiqi/yiqilist.jsp?pg=${param.pg+1}&userfor=${param.userfor}&yiqiname=${param.yiqiname}&unit=${param.unit}&factory=${param.factory}&relation=${param.relation }' />">下页</a>
                   		</c:otherwise>
                   	</c:choose>
                    
                </div>
           
</body>
</html>